﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HotelBooking
{
    public static class Decoder
    {
        public static void SendOrderObject()
        {
            //enviar orderobject to HotelSupplier
        }

        public static OrderObject ConvertOrderString(string order)
        {
            OrderObject orderObj = Decoding(order);
            return orderObj;
        }
        public static OrderObject Decoding(string ob_string)
        {
            OrderObject order = null;
            if (!String.IsNullOrEmpty(ob_string))
            {
                order = new OrderObject();
                String[] arrayData = new String[4];
                arrayData = ob_string.Split(' ');
                try
                {
                    order.SenderId = Int32.Parse(arrayData[0]);
                    order.CardNo = Int32.Parse(arrayData[1]);
                    order.ReceiverID = Int32.Parse(arrayData[2]);
                    order.Amount = Int32.Parse(arrayData[3]);

                }
                finally
                {


                }

            }
            return order;
        }
    }
}
